package com.limou.service;

import com.limou.pojo.User;
import com.limou.pojo.UserQueryDTO;

import javax.xml.bind.ValidationException;
import java.util.List;

public interface UserService {


    /**
     * 检查登录
     * @param user
     * @return
     */
    User checkLogin(User user);

    /**
     * 根据id查询用户
     * @param id
     * @return
     */
    User queryUserById(Integer id);

    /**
     * 用户注册
     * @param user
     */
    void register(User user);

    /**
     * 根据用户名查询用户对象
     * @param username
     */
    User queryUserByUsername(String username);


    /**
     * 添加
     *
     * @param user
     * @return int
     * @throws ValidationException
     */
    int insert(User user) throws ValidationException;

    /**
     * 删除
     *
     * @param id 主键
     * @return int
     * @throws ValidationException
     */
    int delete(Integer id) throws ValidationException;

    /**
     * 修改
     *
     * @param user
     * @return int
     * @throws ValidationException
     */
    int updateData(User user) throws ValidationException;

    /**
     * 查询分页数据
     * @return List<User>
     */
    List<User> getList(UserQueryDTO dto) throws ValidationException;


}
